<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta name="author" content="彭俊超">
    <title>下拉菜单</title>
    <style>
        div{
            width:800px;
            height:600px;
            margin:20px auto;
        }
        div>ul{ 
            width:800px;
            height:80px;
            list-style: none;
            margin:0px;
            padding:0px;
            background-color:#ccc;
            display: flex;
        }
        li{
            width:200px;
            line-height:80px;
            text-align:center;
        }
        div ul ul{
            padding:0px;
            margin:0px;
            list-style: none;
            background-color:coral;
            display: none;
        }
    </style>
</head>

<body>
<div>
    <ul class="outer">
        <li>
            <span>公司简介</span>
            <ul class="com">
                <li>概况介绍</li>
                <li>发展历程</li>
                <li>公司实力</li>
            </ul>
        </li>
        <li>
            <span>产品介绍</span>
            <ul>
                <li>软件研发</li>
                <li>软件教育</li>
                <li>天使投资</li>
            </ul>
        </li>
        <li>
            <span>联系我们</span>
            <ul>
                <li>公司地址</li>
                <li>联系方式</li>
                <li>加盟地址</li>
            </ul>
        </li>
        <li>
            <span>人才招聘</span>
            <ul>
                <li>java招聘</li>
                <li>html5招聘</li>
                <li>php招聘</li>
            </ul>
        </li>
    </ul>
</div>


<script src="./jquery.js"></script>
</body>

</html>

<script>
   $('.outer>li').mouseover(function(){
       $('.outer>li>span').each(function(){
           $('.outer>li>span').css({'color':'black','text-decoration':'none'})
       })
       $('.outer li ul').each(function(){
            $('.outer li ul').css('display','none');
       })
       $(this).find('span').css({'color':'orange','text-decoration':'underline'});
       $(this).find('span').siblings().css('display','block').end().find('ul').css('display','none');
       $('.outer ul li').mouseover(function(){
           $(this).css('text-decoration','underline').siblings().css('text-decoration','none');
       })
   })
    $('.outer>li').mouseout(function(){
        $(this).find('ul').css('display','none');
        $(this).find('span').css({'color':'black','text-decoration':'none'});
    })

</script>